package com.lovetemperature.action;

import java.util.List;

import com.lovetemperature.model.Order;
import com.lovetemperature.model.Staff;
import com.lovetemperature.service.OrderService;
import com.lovetemperature.service.ShopService;
import com.lovetemperature.service.StaffService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ShowOrdersAction  extends ActionSupport{
	private OrderService orderService;
	private StaffService staffService;
	private ShopService shopService;
	private List<Order> orderList;
	private String shopName;

	@Override
	public String execute() throws Exception {
		Staff user = (Staff) ActionContext.getContext().getSession().get("user");
		orderList = shopService.findAllOrder(user.getWorkingShop().getShopId());
		shopName = user.getWorkingShop().getName();
		return super.execute();
	}

	public OrderService getOrderService() {
		return orderService;
	}

	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}

	public StaffService getStaffService() {
		return staffService;
	}

	public void setStaffService(StaffService staffService) {
		this.staffService = staffService;
	}

	public List<Order> getOrderList() {
		return orderList;
	}

	public void setOrderList(List<Order> orderList) {
		this.orderList = orderList;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public ShopService getShopService() {
		return shopService;
	}

	public void setShopService(ShopService shopService) {
		this.shopService = shopService;
	}

}
